﻿namespace NetFx.MSIL
{
  using System;
  using System.Text;
  using System.Threading;
  using System.Collections;

  using System.Reflection;
  using System.Reflection.Emit;

  using NetFx.SMIL;
  using NetFx.SMIL.Definitions;


  public class GenericParameterGenerator:TypeGenerator
  {
    #region Statics
    public static GenericParameterGenerator of(GenericTypeParameterBuilder builder)
    {
      return new GenericParameterGenerator(builder);
    }
    #endregion
    #region Fields
    protected Type baseTypeConstrain = null;
    protected Type[] interfaceConstrains = null;
    #endregion
    #region Properties
    public new virtual GenericTypeParameterBuilder Builder
    {
      get { return this.builder as GenericTypeParameterBuilder; }
    }
    public virtual Type BaseTypeConstrain
    {
      get
      {
        return this.baseTypeConstrain;
      }
      set
      {
        this.Builder.SetBaseTypeConstraint(this.baseTypeConstrain = value);
      }
    }
    public virtual Type[] InterfaceConstains
    {
      get
      {
        return this.interfaceConstrains;
      }
      set
      {
        this.Builder.SetInterfaceConstraints(this.interfaceConstrains = value);
      }
    }
    public virtual GenericParameterAttributes GenericParameterAttributes
    {
      get
      {
        return this.Builder.GenericParameterAttributes;
      }
      set
      {
        this.Builder.SetGenericParameterAttributes(value);
      }
    }
    public virtual int GenericParameterPosition
    {
      get
      {
        return this.Builder.GenericParameterPosition;
      }
    }

    public override DefType GeneratorType
    {
      get { return DefType.GenericParameter; }
    }
    #endregion
    #region Constructors
    public GenericParameterGenerator(GenericTypeParameterBuilder builder):base(builder)
    {
    }
    #endregion
    #region Methods
    #endregion
  }
}
